<template>
  <view class="points-container">
    <!-- 积分信息 -->
    <view class="points-header">
      <view class="points-card">
        <view class="points-info">
          <text class="points-number">{{userPoints}}</text>
          <text class="points-label">可用积分</text>
        </view>
      </view>
    </view>
    
    <!-- 积分记录 -->
    <view class="points-records">
      <view class="section-title">积分记录</view>
      <view class="record-list">
        <view class="record-item" v-for="record in pointsRecords" :key="record.id">
          <view class="record-info">
            <text class="record-title">{{record.title}}</text>
            <text class="record-time">{{record.createTime}}</text>
          </view>
          <text class="record-points">{{record.points > 0 ? '+' : ''}}{{record.points}}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      userPoints: 1350,
      pointsRecords: [
        {
          id: 1,
          title: '完成订单',
          points: 50,
          createTime: '2024-01-15 14:30'
        },
        {
          id: 2,
          title: '每日签到',
          points: 10,
          createTime: '2024-01-15 09:15'
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.points-container {
  background-color: #f5f5f5;
  min-height: 100vh;
}

.points-header {
  background: linear-gradient(135deg, #ffa726 0%, #ff8a65 100%);
  padding: 40rpx;
  
  .points-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20rpx;
    padding: 40rpx;
    text-align: center;
    
    .points-number {
      font-size: 80rpx;
      font-weight: bold;
      color: #ff6b35;
      display: block;
    }
    
    .points-label {
      font-size: 28rpx;
      color: #666666;
    }
  }
}

.points-records {
  background-color: #ffffff;
  margin: 20rpx 0;
  padding: 40rpx;
  
  .section-title {
    font-size: 32rpx;
    font-weight: bold;
    color: #333333;
    margin-bottom: 30rpx;
  }
  
  .record-list {
    .record-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 30rpx 0;
      border-bottom: 2rpx solid #f0f0f0;
      
      &:last-child {
        border-bottom: none;
      }
      
      .record-info {
        flex: 1;
        
        .record-title {
          font-size: 30rpx;
          color: #333333;
          display: block;
          margin-bottom: 5rpx;
        }
        
        .record-time {
          font-size: 24rpx;
          color: #999999;
        }
      }
      
      .record-points {
        font-size: 32rpx;
        font-weight: bold;
        color: #4caf50;
      }
    }
  }
}
</style> 